package com.huawei;

import java.util.Scanner;

/**
 统计大写字母的个数，很简单的题，就花几分钟写一下吧
 */
public class HJ084 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        char[] arr = input.toCharArray();

        int count = 0;
        for(char c:arr){
            if ('A'<=c && c<='Z'){
                count ++;
            }
        }
        System.out.println(count);

    }
}
